package com.engine4cloud.tdf.supervision.dto.create;

import com.engine4cloud.tdf.common.core.constant.enums.ChangePlaceTypeEnum;
import com.engine4cloud.tdf.supervision.dto.JzdxFileDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 执行地变更申请-请求对象
 *
 * @author wenjie
 * @date 2024-04-10 11:04:52
 */
@Data
@Schema(description = "执行地变更申请-请求对象")
public class SpChangePlaceCreateDTO implements Serializable {

    /**
     * 社区矫正人员编号
     */
    @Schema(description = "社区矫正人员编号")
    @NotBlank(message = "社区矫正人员编号不能为空")
    private String rybh;

    /**
     * 变更类型
     */
    @Schema(description = "变更类型(跨省或省内)", example = "TRANS_PROVINCIAL")
    @NotNull(message = "变更类型不能为空")
    private ChangePlaceTypeEnum bglx;

    /**
     * 申请时间
     */
    @Schema(description = "申请时间", example = "2024-01-01 00:00:00")
    @NotNull(message = "申请时间不能为空")
    private LocalDateTime sqsj;

    /**
     * 原执行地
     */
    @Schema(description = "原执行地", example = "海口市美兰区司法局")
    @NotEmpty(message = "原执行地不能为空")
    private String yzxd;

    /**
     * 迁入地明细
     */
    @Schema(description = "迁入地明细")
    @NotBlank(message = "迁入地明细不能为空")
    private String qrdmx;

    /**
     * 变更理由
     */
    @Schema(description = "变更理由")
    @NotBlank(message = "变更理由不能为空")
    @Length(max = 2000, message = "变更理由最大不超过2000个字符串")
    private String jzdbgsy;

    /**
     * 迁入目的地
     */
    @Schema(description = "迁入目的地（执行地变更到县）", example = "[\"460000\",\"46000A\",\"469006\",\"36296\"]")
    @NotEmpty(message = "迁入目的地不能为空")
    @Size(min = 3, message = "迁入目的地必须选到最后一级")
    private List<String> destinationList;

    /**
     * 文书材料
     */
    @Schema(description = "文书材料", example = """
            [{"name": "张三.png",
            "url": "/supervision/oss-file/oss/file?fileName=09468fc20f2544e28891a058858fdf58.jpeg"}
            ]""")
    @NotEmpty(message = "文书材料不能为空")
    private List<JzdxFileDTO> instrumentList;

}